/**
 * Created by webhugo on 16-10-16.
 */
var sequelizex = require('sequelize-short');
var shortDataTypes = sequelizex.DataTypes;

module.exports = function (sequelize, DataTypes) {

    var Note = sequelize.define('Note', {
        content: shortDataTypes.Text(),
        chapter: shortDataTypes.String(50, false, '')
    }, {
        associate: function (models) {
            models.User.hasMany(models.Note);
            models.Note.belongsTo(models.User);
            models.Course.hasMany(models.Note);
            models.Note.belongsTo(models.Course);
        },
        instanceMethods: {
        }
    });

    return Note;
};